package com.CGFrame.struts.action.categorySet;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.CGFrame.struts.POJOs.Catemodel;
import com.CGFrame.struts.bean.ProjectOperate;
import com.CGFrame.struts.bean.category.Catemodelrelbean;
import com.CGFrame.struts.bean.log.LogHistoryBean;

public class DelRelAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		String relid=request.getParameter("relid");
		String modelId=request.getParameter("modelId");
		Catemodelrelbean bean=new Catemodelrelbean();
		bean.delCateModelRel(Integer.valueOf(relid));
		
		LogHistoryBean logBean = new LogHistoryBean();
		String regUserId = (String)request.getSession().getAttribute("RegUserID");
		logBean.saveByReguserId(regUserId, LogHistoryBean.DELETE,"CatemodelrelId:"+relid, "Catemodel", Integer.valueOf(modelId) );
		
		request.setAttribute("modelId", modelId);
	
		return mapping.findForward("detail");
	}
}
